package org.jl;

import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class OrderController {

    @Resource
    private PaymentClient paymentClient;

    @Value("${db.url}")
    private String url;

    @GetMapping("/payment/{id}")
    public String getPayment(@PathVariable("id") Long id) {
        log.info("url={}", url);
        return paymentClient.getPayment(id);
    }
}
